﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;

using ECCIT.IO;
using ECCIT.Business.Model;

namespace ECCIT.Report.Excel
{
    public class BaseReportColumnModel : BaseModel, IReportColumnModel
    {
        public int? ID { get; set; }

        public string ReportGuid { get; set; }

        private IReportModel _reportModel;
        
        public IReportModel ReportModel
        {
            get
            {
                if (_reportModel != null) return _reportModel;
                if (string.IsNullOrEmpty(this.ReportGuid)) return null;

                //此处需要实现lazy load
                return null;
            }
            set
            {
                _reportModel = value;
            }
        }

        /// <summary>
        ///     列物理名称
        /// </summary>
        public string PhysicalName { get; set; }
        
        /// <summary>
        ///     行索引，非列表循环列通过RowIndex和ColumnIndex找到对用的Cell
        /// </summary>
        public int? RowIndex { get; set; }

        /// <summary>
        ///     列索引，非列表循环列通过RowIndex和ColumnIndex找到对用的Cell
        /// </summary>
        public int? ColumnIndex { get; set; }
        
        /// <summary>
        ///     指示该列是否是自动编号列，如果是，从1-n自动编号
        /// </summary>
        public bool? AutoNumber { get; set; }

        /// <summary>
        ///     合计列显示文字
        /// </summary>
        public string SumText { get; set; }

        /// <summary>
        ///     合计列计算公式
        /// </summary>
        public string SumStatement { get; set; }

        /// <summary>
        ///     
        /// </summary>
        public int? Type { get; set; }

        /// <summary>
        ///     指示该列是否可以作为排序列
        /// </summary>
        public bool? Sortable { get; set; }

        /// <summary>
        ///     列显示名称
        /// </summary>
        public string DisplayName { get; set; }
    }
}
